cmake_minimum_required(VERSION 3.0.2)
project(ros_stanley)        # ros包的名称，可以以${PROJECT_NAME}的方式调用
set(CMAKE_CXX_STANDARD 11)
## 构建此软件包所需要依赖的软件包
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation custom_msgs)

## 执行时依赖
catkin_package(CATKIN_DEPENDS roscpp rospy std_msgs message_runtime)


## 添加头文件的路径
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(../../../devel/include) ##include stanley msg header
include_directories(${CMAKE_SOURCE_DIR}/include/eigen)
include_directories(${CMAKE_SOURCE_DIR}/include)

## 生成可执行文件
add_executable(n_stanley_controller src/n_stanley_controller.cpp
                                    src/stanley_controller.cpp)
# 添加可执行文件的依赖
add_dependencies(n_stanley_controller custom_msgs_gencpp)   #让custom_msgs包先编译
add_dependencies(n_stanley_controller ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

# 可执行文件链接相关的库
target_link_libraries(n_stanley_controller ${catkin_LIBRARIES})

